﻿@page "/users/list"

@using BootstrapBlazor.Components;
@using Messhall.UI.Permission.Model

@* <ul class="ul-demo"> *@
@*     <li>通过设置 <code>ShowEmpty="true"</code> 开启无数据显示功能</li> *@
@*     <li><code>EmptyText</code> 参数用于设置无数据时显示文字，默认取资源文件中的内置文字</li> *@
@*     <li><code>EmptyTemplate</code> 参数用于自定义无数据显示模板</li> *@
@* </ul> *@
<Table TItem="UserListModel"
       IsPagination="true" PageItemsSource="@PageItemsSource"
       ShowToolbar="true" ShowSearch="true" IsMultipleSelect="true" ShowExtendButtons="true"
       ShowSearchText="true" ShowCardView ShowColumnList AllowResizing ShowLoading
       FixedExtendButtonsColumn="true"
       IsFixedHeader="true"
       Height="600"
       AddModalTitle="增加用户" EditModalTitle="编辑用户"
       SearchModel="@SearchModel" ShowEmpty="true" SearchMode="SearchMode.Top"
       OnQueryAsync="@OnQueryAsync" OnResetSearchAsync="@OnResetSearchAsync"
       OnAddAsync="@OnAddAsync" OnSaveAsync="@OnSaveAsync" OnDeleteAsync="@OnDeleteAsync">
    <TableColumns>
        <TableColumn @bind-Field="@context.Name" />
        <TableColumn @bind-Field="@context.AccountNo" />
        <TableColumn @bind-Field="@context.Mobile" />
        <TableColumn @bind-Field="@context.Money" />
        <TableColumn @bind-Field="@context.Integral" />
        <TableColumn @bind-Field="@context.IsVip" />
        <TableColumn @bind-Field="@context.PassWord" />
        <TableColumn @bind-Field="@context.CreateTime" />
    </TableColumns>
    <TableToolbarTemplate>
        @* <TableToolbarButton TItem="UserListModel" Color="Color.Primary" Icon="fa fa-fw fa-download" Text="角色" IsAsync  /> *@
        @* <TableToolbarButton TItem="UserListModel" Color="Color.Success" Icon="fa fa-fw fa-edit" Text="下载2" IsAsync /> *@
    </TableToolbarTemplate>
    <SearchTemplate>
        <GroupBox Title="搜索条件">
            <div class="row g-3 form-inline">
                <div class="col-3 col-sm-3">
                    <BootstrapInput @bind-Value="@context.Name" placeholder="请输入姓名" maxlength="10" ShowLabel="true" DisplayText="用户姓名" />
                </div>
                <div class="col-3 col-sm-3">
                    <BootstrapInput @bind-Value="@context.Mobile" placeholder="请输入手机号" maxlength="11" ShowLabel="true" DisplayText="用户手机号" />
                </div>
            </div>
        </GroupBox>
    </SearchTemplate>
     <RowButtonTemplate>
        <TableCellButton Size="Size.ExtraSmall" Color="Color.Primary" Icon="fa fa-edit" Text="明细" OnClickCallback="@(() => OnRowButtonClick(context))" />
        
    </RowButtonTemplate>
</Table>